<!DOCTYPE html>
<html>
<head>
    <title></title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">货架：</div>
            <div style="float: left;width:160px;margin-right: 10px;">
                <select class="form-control" v-model="q.shelvesid" @keyup.enter="query" id="sheelves_id">

                </select>
            </div>
            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">盘点时间：</div>
            <div style="float: left;width:350px;margin-right: 10px;" id="sandbox-container">

                <div class="input-group date" style="width:46%;float:left;">
                    <input type="text" class="form-control" id="startime"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                </div>
                <div style="width: 4%;float:left;margin-left:7px;margin-top:8px;padding-left:1px;">
                    -
                </div>
                <div class="input-group date" style="width:48%;">
                    <input type="text" class="form-control" id="endtime"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
                </div>

            </div>
            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">盘点单号：</div>
            <div style="float: left;width:160px;margin-right: 10px;">
                <input type="text" class="form-control" v-model="q.number" @keyup.enter="query" placeholder="请输入内容">
            </div>
            <a class="btn btn-primary" @click="query">查询</a>
			<#if shiro.hasPermission("sys:stockpurpose:save")>
            <a class="btn btn-primary" @click="add">&nbsp;新增盘点</a>
			</#if>

        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showAddList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form>
            <div style="padding: 20px 0;margin: 0 20px;box-sizing: border-box;border-bottom: 1px solid #E2E5ED;">
                <h4 style="font-size: 16px!important;font-weight: 700;">基本信息</h4>
                <div style="margin-bottom: 20px!important;margin-top: 20px!important;display: table;width: 100%!important;">
                    <label style="width: 100px!important;font-size: 16px;text-align: right;
                            margin: 0;vertical-align: top!important;display: table-cell!important;line-height: 54px">
                        <span style="display: inline-block;color: #f07065;">*</span>
                        货架名称：
                    </label>
                    <div style="display: table-cell!important;vertical-align: middle;position: relative;">
                        <select class="form-control" style="width: 20%" id="shelvesName" v-model="stockpurpose.shelvesid" @change="changeShelves">

                        </select>
                    </div>
                </div>
                <div style="position: relative;margin-top: 20px!important;display: table;width: 100%!important;">
                    <label style="width: 100px!important;font-size: 16px!important;
                            display: table-cell!important;vertical-align: top!important;text-align: right;padding-right: 15px;line-height: 32px;">
                        备注：
                    </label>
                    <div style="vertical-align: middle;display: table-cell!important;">
                                <textarea style="height: 100px;border: 1px solid #e2e5ed;border-radius: 3px;
                                box-sizing: border-box;padding: 9px 10px;resize: none;font-size: 14px;width: 100%!important;" type="text" placeholder="输入备注信息(非必填)" v-model="stockpurpose.remark"></textarea>
                    </div>
                </div>
            </div>
            <div style="padding: 20px 0;margin: 0 20px;box-sizing: border-box;">
                <div style="box-sizing: border-box;margin-bottom: 10px!important;height: 33px;">
                    <div style="box-sizing: border-box;float: left;margin: 0!important;line-height: 32px;">
                        <span style="font-size: 16px!important;font-weight: 700;">选择商品</span>
                        <span style="box-sizing: border-box;padding: 0 15px;font-size: 14px;color: #4c4948;">商品种类：<span id="zl">0</span></span>
                       </div>
                    <div style="float: right;">
                        <a class="btn btn-default" @click="addProduct" style="background-color: #f07065!important;color:#fff">&nbsp;添加商品</a>
                    </div>
                </div>
                <div style="border-radius: 2px;border: none!important;margin: 0!important;">
                    <div style="margin-bottom: 0;border: 1px solid #e2e5ed!important;min-height: .01%;margin-top: 15px;">
                        <table style="border-top-left-radius: 3px;border-top-right-radius: 3px;
                                border: 0;display: table;margin-bottom: 0!important;width: 100%;border-collapse: collapse;">
                            <thead style="background-color: #F7F9FB;">
                            <tr>
                                <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;" width="80"></th>
                                <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">商品名称</th>
                                <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">商品数量</th>
                                <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盘点后数量</th>
                                <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盈亏数量</th>
                                <th style="border-top: 0;border-bottom: 0;border-left: 0;padding: 10px 0;
                                            font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">操作</th>
                            </tr>

                            </thead>
                            <tbody id="goods">
                            <tr style="height:39px;">
                                <td colspan="6" style="text-align: center;background-color: #fff!important;border-top:solid 1px rgb(226, 229, 237);">您还未选择商品</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div style="margin-top: 20px!important;">
                    <a class="btn btn-primary" @click="saveOrUpdate">&nbsp;保存</a>
                    <a class="btn btn-default" @click="reload">&nbsp;返回</a>
                </div>
            </div>
        </form>
    </div>

    <div v-show="!showInfoList" class="panel panel-default">
        <div class="panel-heading">盘点详情</div>
        <div style="padding: 20px 0;margin: 0 20px;box-sizing: border-box;padding-bottom: 0!important;">
            <div style="border: none!important;margin: 0!important;">
                <div style="border: 1px solid #e2e5ed!important;">
                    <table style="border: 0;width: 100%;border-collapse: collapse;">
                        <tbody>
                        <tr>
                            <td style="border-top: none;border-bottom:solid 1px rgb(226, 229, 237);border-right:solid 1px rgb(226, 229, 237);
                                        padding: 10px;float: none;text-align: center;width: 8.33333333%;background-color: #F7F9FB;">盘点订单</td>
                            <td style="border-bottom:solid 1px rgb(226, 229, 237);border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;background-color: #fff!important;width: 16.66666667%;" id="purposenumber"></td>
                            <td style="border-top: none;border-bottom:solid 1px rgb(226, 229, 237);border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;text-align: center;width: 8.33333333%;background-color: #F7F9FB;">操作人</td>
                            <td style="border-bottom:solid 1px rgb(226, 229, 237);border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;background-color: #fff!important;width: 16.66666667%;" id="createuser"></td>
                            <td style="border-top: none;border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;text-align: center;width: 8.33333333%;background-color: #F7F9FB;">货架名称</td>
                            <td style="border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;background-color: #fff!important;width: 16.66666667%;" id="shelvesnames"></td>
                            <td style="border-top: none;border-bottom:solid 1px rgb(226, 229, 237);border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;text-align: center;width: 8.33333333%;background-color: #F7F9FB;">操作时间</td>
                            <td style="border-bottom:solid 1px rgb(226, 229, 237);padding: 10px;float: none;background-color: #fff!important;width: 16.66666667%;" id="createtime"></td>
                        </tr>
                        <tr>
                            <td style="border-top: none;border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;text-align: center;width: 8.33333333%;background-color: #F7F9FB;">备注</td>
                            <td style="border-right:solid 1px rgb(226, 229, 237);padding: 10px;float: none;background-color: #fff!important;width: 16.66666667%;" colspan="7" id="remark">--</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div style="padding-top: 10px !important; padding-right: 0px;  padding-left: 0px; margin: 10px 0px 10px 20px;">
            <p style="font-size: 18px !important; margin: 0px 0px 10px; line-height: 1 !important;font-weight:bold;">选择商品</p>
        </div>
        <div style="padding: 20px 0;margin: 0 20px;padding-top: 0!important;">
            <div style="margin-top: 10px!important;margin-bottom: 10px!important;height: 33px;">
                <div style="margin: 0 20px;float: left;margin: 0!important;line-height: 32px;">
                    <span style="box-sizing: border-box;padding-right: 15px;font-size: 14px;color: #4c4948;border-right: 1px solid #e2e5ed;">商品种类：<span id="spzl">0</span></span>
                    <span style="box-sizing: border-box;padding: 0 15px;font-size: 14px;color: #4c4948;border-right: 1px solid #e2e5ed;">盈亏数量：<span id="yksl">0</span></span>
                    <span style="box-sizing: border-box;padding: 0 15px;font-size: 14px;color: #4c4948;">合计盈亏金额：￥<span id="hjykje"></span></span>
                </div>
            </div>
            <div style="border-radius: 2px;border: none!important;margin: 0!important;">
                <div style="margin-bottom: 0;min-height: .01%;margin-top: 15px;">
                    <table style="border-top-left-radius: 3px;border-top-right-radius: 3px;
                                border: 1px solid #e2e5ed!important;display: table;margin-bottom: 0!important;width: 100%;border-collapse: collapse;">
                        <thead style="background-color: #F7F9FB;">
                        <tr>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">商品图片</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">商品名称</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盘点前数量</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盘点后数量</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盈亏数量</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">平均成本价</th>
                            <th style="border-right:solid 1px rgb(226, 229, 237);padding: 10px 0;
                                                font-weight: 400!important;font-size: 12px!important;line-height: 1.42857143;text-align: center;">盈亏金额</th>
                        </tr>
                        </thead>
                        <tbody id="infoproduct">
                        <tr style="height:39px;">
                            <td colspan="7" style="text-align: center;background-color: #fff!important;border:solid 1px rgb(226, 229, 237);">暂无数据</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div style="margin-top: 20px!important;">
                <a class="btn btn-default" @click="reload">&nbsp;返回</a>
            </div>
        </div>
    </div>

    <div class="modal fade" id="myProductModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form class="form-horizontal">
                <div class="modal-content" style="width: 650px;">
                    <div style="padding: 15px;">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <div style="padding: 20px 0;border-bottom: 1px solid #E2E5ED;">
                            <p style="font-size: 14px;color: #4c4948;float: left;margin: 0!important;">选择商品</p>
                        </div>
                    </div>
                    <div class="modal-body">
                        <div style="margin-bottom: 15px">
                            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">商品名称：</div>
                            <div style="float: left;width:160px;margin-right: 10px;">
                                <input type="text" class="form-control" v-model="qp.name" @keyup.enter="queryProduct" placeholder="请输入内容">
                            </div>
                            <div style="float: left;margin-left:10px;height:34px;line-height:34px;">商品分类：</div>
                            <div style="float: left;width:160px;margin-right: 10px;">
                                <select class="form-control" v-model="qp.categoryid" @keyup.enter="queryProduct" id="p_id">

                                </select>
                            </div>
                            <a class="btn btn-primary" @click="queryProduct">搜索</a>
                        </div>

                        <table id="jqGridAddProudct" style="width: 100%;"></table>
                        <div id="jqGridPagerAddProudct" style="width: 100%"></div>
                        <a class="btn btn-primary" @click="showProduct" style="margin-left: 290px;margin-top: 10px">确定</a>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/stockpurpose.js?_${.now?long}"></script>
<script>
    $("#sandbox-container .input-group.date").datepicker({
        language: "zh-CN",
        clearBtn: true, //清除按钮
        format: "yyyy-mm-dd",
        todayHighlight:true
    });
</script>
</body>
</html>